{include file="common/_header"}
{include file="common/_header1"}

<body class="layui-anim layui-anim-up">

<div class="x-body">
<!--    <div class="layui-row">-->
<!--        <form class="layui-form layui-col-md12 x-so">-->
<!--            <form class="layui-form layui-col-md12 x-so">-->
<!--                <div class="layui-input-inline">-->
<!--                    <input type="text" name="paper_id" style="display:none;" value="{$data.get.paper_id}" autocomplete="off" class="layui-input">-->
<!--                    <div class="layui-unselect layui-form-select shop_id" style="display:inline-block;">-->
<!--                        <input type="text" name="title"  placeholder="请输入题目标题" value="{//$data.get['title']}" autocomplete="off" class="layui-input">-->
<!--                    </div>-->
<!--                    <button class="layui-btn"  lay-submit="" lay-filter="sreach"><i class="layui-icon">&#xe615;</i></button>-->
<!--                </div>-->
<!--            </form>-->
<!--        </form>-->
<!--    </div>-->



    <table id="tables" class="layui-table">

        <thead>
        <tr>
            <th>题目</th>
            <th>回答</th>
            <th>问卷提交时间</th>
        </tr>
        </thead>
        <tbody>
        {volist name="data.data" id="vo"}
        <tr class="table_tr">
            <td>{$vo.ques_title}</td>
            <td>{$vo.answer}.{$vo.answer_cont}</td>
            <td>{$vo.add_time|date="Y-m-d H:i:s"}</td>
        </tr>
        {/volist}
        </tbody>
    </table>
    <div class="page_all">
        {$page|raw}
    </div>
</div>
<script>

    $(function () {
        // 表格选中行的同时选中单选框
        $("#tables tr:gt(0)").click(function () {
            $(this).find(":radio").prop("checked", true);
        });

    });

    //js放到table下，才能检测到tr数组
    var trs = document.getElementById("tables").getElementsByTagName("tr");
    $(function () {
        for (var i = 0; i < trs.length; i++) {
            trs[i].onmousedown = function () {
                mousedownclick(this);
            }
        }
    });

    function mousedownclick(obj) {
        for (var j = 0; j < trs.length; j++) {
            if (trs[j] == obj) {
                if (trs[0] != obj) {
                    trs[j].style.background = '#D0E9C6';
                    // 启用新增和编辑按钮
                    $("#edits").removeAttr("disabled");//启用按钮
                    $('#edits').removeClass('layui-disabled');
                }
            } else {
                trs[j].style.background = '';
            }
        }
    }
</script>
</body>

{include file="common/_bottom"}